'use strict';
module.exports = app => {
  const { STRING, BOOLEAN, BIGINT, TINYINT } = app.Sequelize;

  const VerifyCode = app.model.define('verifyCode', {
    account: {
      type: STRING,
      allowNull: false,
      comment: '要验证的账户',
    },
    code: {
      type: BIGINT,
      allowNull: false,
      comment: '验证码',
    },
    number: {
      type: BIGINT,
      allowNull: false,
      defaultValue: 1,
      comment: '获取验证码的次数',
    },
    type: {
      type: TINYINT,
      allowNull: false,
      comment: '类型(1:手机;2:邮箱;)',
    },
    stutas: {
      type: BOOLEAN,
      allowNull: false,
      defaultValue: false, // 设置默认值
      comment: '是否已验证成功 1 true ｜ 0 false',
    },

  });

  return VerifyCode;
};
